Optimal. Leaf size=39 \[ \frac{x}{b}-\frac{\sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a} \tanh (x)}{\sqrt{a+b}}\right )}{b \sqrt{a+b}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0695004, antiderivative size = 39, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3171, 3181, 208} \[ \frac{x}{b}-\frac{\sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a} \tanh (x)}{\sqrt{a+b}}\right )}{b \sqrt{a+b}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3171
Rule 3181
Rule 208
Rubi steps
\begin{align*} \int \frac{\cosh ^2(x)}{a+b \cosh ^2(x)} \, dx &=\frac{x}{b}-\frac{a \int \frac{1}{a+b \cosh ^2(x)} \, dx}{b}\\ &=\frac{x}{b}-\frac{a \operatorname{Subst}\left (\int \frac{1}{a-(a+b) x^2} \, dx,x,\coth (x)\right )}{b}\\ &=\frac{x}{b}-\frac{\sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a} \tanh (x)}{\sqrt{a+b}}\right )}{b \sqrt{a+b}}\\ \end{align*}
Mathematica [A] time = 0.0803585, size = 36, normalized size = 0.92 \[ \frac{x-\frac{\sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a} \tanh (x)}{\sqrt{a+b}}\right )}{\sqrt{a+b}}}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.026, size = 107, normalized size = 2.7 \begin{align*}{\frac{1}{b}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }-{\frac{1}{2\,b}\sqrt{a}\ln \left ( \sqrt{a+b} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+2\,\sqrt{a}\tanh \left ( x/2 \right ) +\sqrt{a+b} \right ){\frac{1}{\sqrt{a+b}}}}+{\frac{1}{2\,b}\sqrt{a}\ln \left ( \sqrt{a+b} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}-2\,\sqrt{a}\tanh \left ( x/2 \right ) +\sqrt{a+b} \right ){\frac{1}{\sqrt{a+b}}}}-{\frac{1}{b}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.99759, size = 880, normalized size = 22.56 \begin{align*} \left [\frac{\sqrt{\frac{a}{a + b}} \log \left (\frac{b^{2} \cosh \left (x\right )^{4} + 4 \, b^{2} \cosh \left (x\right ) \sinh \left (x\right )^{3} + b^{2} \sinh \left (x\right )^{4} + 2 \,{\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )^{2} + 2 \,{\left (3 \, b^{2} \cosh \left (x\right )^{2} + 2 \, a b + b^{2}\right )} \sinh \left (x\right )^{2} + 8 \, a^{2} + 8 \, a b + b^{2} + 4 \,{\left (b^{2} \cosh \left (x\right )^{3} +{\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + 4 \,{\left ({\left (a b + b^{2}\right )} \cosh \left (x\right )^{2} + 2 \,{\left (a b + b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) +{\left (a b + b^{2}\right )} \sinh \left (x\right )^{2} + 2 \, a^{2} + 3 \, a b + b^{2}\right )} \sqrt{\frac{a}{a + b}}}{b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \,{\left (2 \, a + b\right )} \cosh \left (x\right )^{2} + 2 \,{\left (3 \, b \cosh \left (x\right )^{2} + 2 \, a + b\right )} \sinh \left (x\right )^{2} + 4 \,{\left (b \cosh \left (x\right )^{3} +{\left (2 \, a + b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + b}\right ) + 2 \, x}{2 \, b}, -\frac{\sqrt{-\frac{a}{a + b}} \arctan \left (\frac{{\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2} + 2 \, a + b\right )} \sqrt{-\frac{a}{a + b}}}{2 \, a}\right ) - x}{b}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.22802, size = 68, normalized size = 1.74 \begin{align*} -\frac{a \arctan \left (\frac{b e^{\left (2 \, x\right )} + 2 \, a + b}{2 \, \sqrt{-a^{2} - a b}}\right )}{\sqrt{-a^{2} - a b} b} + \frac{x}{b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]